package com.oauth.service.generic;

import java.util.List;
import java.util.Set;

import com.oauth.service.generic.beans.OAuthServiceBean;
import com.oauth.service.generic.exception.OAuthServiceException;

public interface OAuthService {
	/**
	 * @param pServiceBean
	 * @return
	 * @throws OAuthServiceException
	 */
	public OAuthServiceBean persistToken(OAuthServiceBean pServiceBean)
			throws OAuthServiceException;

	/**
	 * @param memberId
	 * @param applicationId
	 * @throws OAuthServiceException
	 */
	void deleteToken(Long memberId, Long applicationId) throws OAuthServiceException;

	/**
	 * @param memberId
	 * @param applicationId
	 * @return
	 * @throws OAuthServiceException
	 */
	OAuthServiceBean getToken(Long memberId, Long applicationId) throws OAuthServiceException;

	/**
	 * @param memberId
	 * @return
	 * @throws OAuthServiceException
	 */
	List<OAuthServiceBean> getAllTokens(Long memberId) throws OAuthServiceException;

	/**
	 * @param memberId
	 * @return
	 * @throws OAuthServiceException
	 */
	Set<Long> getApplicationsByMember(Long memberId) throws OAuthServiceException;

}
